package com.ttl.common.db;

import java.sql.Connection;
import java.sql.DriverManager;

public class DB {
	public void dbConnect(String db_connect_string, 
			String db_userid, String db_password) {
		try{
			//Class.forName("net.sourceforge.jtds.jdbc.Driver");						   
			//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
			//ผิด -> Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
			Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");			

			Connection conn = DriverManager.getConnection(
			db_connect_string, db_userid, db_password);							
			System.out.println("connected");			
			conn.close();
		} catch (Exception e){
			e.printStackTrace();
		}
	}
}
